package servlet;

import java.io.IOException;
import java.sql.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.LyTable;
import model.User;
import db.DB;

public class AddServlet extends HttpServlet{
	public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
		request.setCharacterEncoding("gb2312");
		response.setCharacterEncoding("gb2312");
		String title=request.getParameter("title");
		String content=request.getParameter("content");
		User user=(User)request.getSession().getAttribute("user");
		LyTable ly=new LyTable();
		ly.setUserId(user.getId());
		ly.setDate(new Date(System.currentTimeMillis()));
		ly.setTitle(title);
		ly.setContent(content);	
	}
}
